<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>translate 代替 top减少回流</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        #rect{
            position: relative;
            top: 0;
            /*transform: translateY(0);*/
            width: 100px;
            height: 100px;
            background: blue;
        }
    </style>
</head>
<body>
    <div id="rect"></div>
    <script type="text/javascript">
        setTimeout(() =>{
            document.getElementById('rect').style.top = '100px'
        },2000)
    </script>
</body>
</html>